package vn.anhqn.englishsentensetranslator.SentenseLookup;

import android.content.Context;
import android.view.View;
import vn.anhqn.englishsentensetranslator.R;
import vn.anhqn.englishsentensetranslator.utils.BaseDialog;

public class DialogConfirmDelete extends BaseDialog implements android.view.View.OnClickListener {
	confirmDeleteListener listener;

	public DialogConfirmDelete(Context context) {
		super(context);
	}

	@Override
	protected int getLayoutResId() {
		return R.layout.custom_yes_no_dialog;
	}

	public void setListener(confirmDeleteListener listener) {
		this.listener = listener;
	}

	@Override
	protected void onCreateContent(View pContentView) {
		findViewById(pContentView, R.id.btn_ok).setOnClickListener(this);
		findViewById(pContentView, R.id.btn_cancel).setOnClickListener(this);
	}

	@Override
	public void onClick(View v) {
		int id = v.getId();
		switch (id) {
		case R.id.btn_ok:
			if (listener != null)
				listener.onOK();
			dismiss();

			break;
		case R.id.btn_cancel:
			dismiss();

			break;

		default:
			break;
		}
	}

	public interface confirmDeleteListener {
		public void onOK();
	}
}
